package com.ruoyi.exa.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exa.mapper.ExaQuestionOptionsMapper;
import com.ruoyi.exa.domain.ExaQuestionOptions;
import com.ruoyi.exa.service.IExaQuestionOptionsService;

/**
 * 试题选项Service业务层处理
 * 
 * @author linziheng
 * @date 2025-06-13
 */
@Service
public class ExaQuestionOptionsServiceImpl implements IExaQuestionOptionsService 
{
    @Autowired
    private ExaQuestionOptionsMapper exaQuestionOptionsMapper;

    /**
     * 查询试题选项
     * 
     * @param id 试题选项主键
     * @return 试题选项
     */
    @Override
    public ExaQuestionOptions selectExaQuestionOptionsById(Long id)
    {
        return exaQuestionOptionsMapper.selectExaQuestionOptionsById(id);
    }

    /**
     * 查询试题选项列表
     * 
     * @param exaQuestionOptions 试题选项
     * @return 试题选项
     */
    @Override
    public List<ExaQuestionOptions> selectExaQuestionOptionsList(ExaQuestionOptions exaQuestionOptions)
    {
        return exaQuestionOptionsMapper.selectExaQuestionOptionsList(exaQuestionOptions);
    }

    /**
     * 新增试题选项
     * 
     * @param exaQuestionOptions 试题选项
     * @return 结果
     */
    @Override
    public int insertExaQuestionOptions(ExaQuestionOptions exaQuestionOptions)
    {
        exaQuestionOptions.setCreateTime(DateUtils.getNowDate());
        return exaQuestionOptionsMapper.insertExaQuestionOptions(exaQuestionOptions);
    }

    /**
     * 修改试题选项
     * 
     * @param exaQuestionOptions 试题选项
     * @return 结果
     */
    @Override
    public int updateExaQuestionOptions(ExaQuestionOptions exaQuestionOptions)
    {
        exaQuestionOptions.setUpdateTime(DateUtils.getNowDate());
        return exaQuestionOptionsMapper.updateExaQuestionOptions(exaQuestionOptions);
    }

    /**
     * 批量删除试题选项
     * 
     * @param ids 需要删除的试题选项主键
     * @return 结果
     */
    @Override
    public int deleteExaQuestionOptionsByIds(Long[] ids)
    {
        return exaQuestionOptionsMapper.deleteExaQuestionOptionsByIds(ids);
    }

    /**
     * 删除试题选项信息
     * 
     * @param id 试题选项主键
     * @return 结果
     */
    @Override
    public int deleteExaQuestionOptionsById(Long id)
    {
        return exaQuestionOptionsMapper.deleteExaQuestionOptionsById(id);
    }
    @Override
    public int  deleteExaQuestionOptionsByQuestionId(Long questionId)
    {
        return exaQuestionOptionsMapper.deleteExaQuestionOptionsByQuestionId(questionId);
    }
}
